/*$Id: WidgetService.java 33 2008-02-25 18:12:57Z glenn $*/
package com.leetech.gwt.client;

import com.google.gwt.user.client.rpc.RemoteService;
import com.leetech.gwt.client.WidgetController.WidgetDTO;

/**
 * <p>
 * An interface for servlets which receive RPCs to populate {@link
 * RCWidget} instances with items.  For each type of widget fields 
 * in the WidgetDTO object mean slightly different things. </p>
 * <ul> 
 * <li> name - the name the servlet uses to identify the widget.  
 * This is set by the GUI and should not be changed unless the 
 * servlet decides to change the "identify" of the widget.  When
 * using this with hibernate is is convenient to set it to a 
 * corresponding property of a hibernate object. 
 * </li>
 * <li> label - this is the label text if the widget was passed as a 
 * LabeledWidget. 
 * </li> 
 * <li>  type - the servlet class name.  If the servlet is passed as a 
 * LabeledWidget the type will be set to the widget contained in this
 * class. 
 *  </li> 
 *  <li>values - This field is used for ListBox and Suggestion Oracle widgets.
 * For ListBoxs it is the values in the list box.  For Suggestion Oracle's it 
 * contains all suggestions the oracle may suggest. For ValidatedTextBoxs
 * the first element in the array contains a regular expression for validation.
 * </li> 
 * <li> state - For TextBox type widgets, the first element in the array is
 * the text in the box.  For ListBoxs this array contains the selected items.
 * </li>
 * </ul>
 * 
 * 
 * 
 *
 * @author $LastChangedBy: glenn $.
 * @version $Rev: 33 $ $Date: 2008-02-25 08:12:57 -1000 (Mon, 25 Feb 2008) $.
 */
public interface WidgetService extends RemoteService {
    // Static initialization--------------------------------------------
    // Instance variables-----------------------------------------------
    // Constructors-----------------------------------------------------
    // Methods----------------------------------------------------------

    /**
     * The client will call this method to get the data to initialize
     * a set of {@link RCWidget}s.
     *
     * @param emptyData An array of {@link QueryWidgetDTO} objects
     * which need to be populated.
     * @return A {@link QueryWidgetDTO}[] array of populated instances.
     */
    public WidgetDTO[] syncWidgetDTOs(WidgetDTO[] clientDTOs);


    // Inner classes----------------------------------------------------
}
